-- GENERATED SPELL FOR [Cave Stalker] --


function spell0_4040(pUnit, Event) --@Leech Poison,Drain--
pUnit:FullCastSpellOnTarget(3358,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_4040', 40000, 1)
end

function Sorts_4040(pUnit, Event)
local choix_sorts_4040 = math.random(0, 0)
if choix_sorts_4040 == 0 then
pUnit:RegisterEvent('spell0_4040', 1, 1)
end
end

function mob4040_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_4040', math.random(1500, 3000), 1)
end

function mob4040_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4040_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4040_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(4040, 1, 'mob4040_Action')
RegisterUnitEvent(4040, 2, 'mob4040_Leave')
RegisterUnitEvent(4040, 3, 'mob4040_Kill')
RegisterUnitEvent(4040, 4, 'mob4040_Die')
